<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a th:if="${flag=='yes'}" th:href="@{http://www.baidu.com(id=123)}">flag==yes</a>
<a th:unless="${flag=='no'}">flag!=no</a>
</body>
</html>